<template>
  <div>
    <ul>
      <li v-for="(v,i) in wenda" :key="i" @click="fun(i)">
        <h1>{{v.title}}</h1>
        <div class="block">
          <img :src="v.imgurl" alt="">
          <h5>{{v.people}}</h5>
        </div>
        <div class="block2">
          <p>
            <span>{{v.gangwei1}}</span>
            <van-icon name="arrow" />
          </p>
          <span>写回答</span>
        </div>
      </li> 
    </ul>
  </div>
</template>

<script>
export default {
    data(){
    return {
      arrid:0
    }
  },
  computed:{
    wenda(){
      return this.$store.state.wen
    }
  },
   methods:{
    // fun(index){
    //   this.arrid = this.$store.state.wen[index].id
    //   this.$router.push({ path: '/detail',query:{ id: this.arrid, i: index }})
    // }
  }
};
</script>

<style scoped>
li{
  margin-bottom: 0.10rem;
  padding: 0.16rem;
  background: #fff;
}
li > h1 {
  margin: 0.08rem 0;
  font-weight: bold;
}
li > .block {
  display: flex;
  align-items: center;
  margin: 0.10rem 0;
}
li > .block > h5 {
  margin-bottom: 0.04rem;
  font-size: 0.12rem;
  color: #999;
}
li > .block > p {
  margin: 0.10rem 0;
  font-weight: bold;
  color: #666;
}
li > .block > img{
width: 0.20rem;
    height: 0.20rem;
    border-radius: 50%;
    margin-right: 0.05rem;
}
li > .block2 {
  display: flex;
  justify-content: space-between;
}
li > .block2 > p {
      font-size: 0.14rem;
      color: #999;
}
li >  .block2 > p > span{
  margin-right: 0.06rem;
}
li > .block2 > span {
    width: 0.56rem;
    height: 0.26rem;
    line-height: 0.26rem;
    background: #39c0ba;
    text-align: center;
    font-size: 0.14rem;
    border-radius: 0.04rem;
    color: #fff;
}
</style>